<include file="Public:header" />
{:W('Navigation')}
<div class="body-right">
	<div class="row-table">
		<div class="row-table-title"><if condition="$send == 0">收件箱<else /><a href="{:U('core/message/index')}">收件箱</a></if>
				<if condition="$send == 1">发件箱<else /><a href="{:U('core/message/index','send=1')}">发件箱</a></if></div>
		<div class="row-table-body">
			<p class="form-title">
			<if condition="$send == 1">
				全部
			<else />
				<a class="pull-right btn btn-primary btn-xs" href="{:U('core/message/send')}">写信</a>
				<if condition="$read == 1">
					全部
					<a href="{:U('core/message/index','read=0')}">未读</a>
				<else />
					<a href="{:U('core/message/index')}">全部</a>
					未读
				</if>
			</if>
			</p>
			<table class="table" style="margin-bottom:0px;">
				<form action="{:U('core/message/delete')}" method="post">
				<tbody>
					<tr>
						<th><input type="checkbox" id="check_all"/></th>
						<if condition="$send == 1">
						<th>收件人</th>
						<else />
						<th>发件人</th>
						</if>
						<th>标题</th>
						<th>时间</th>
						<th>状态</th>
						<th>回复</th>
						</if>
						<th>操作</th>
					</tr>
					<volist name="messagelist" id="vo">
					<tr>
						<td><input type="checkbox" name="message_id[]" value="{$vo.message_id}" class="check_list"></td>
						<td><if condition="$send == 1">{$vo.to_name}<else />{$vo.name}</if></td>
						<td><a href="{:U('core/message/view','id='.$vo['message_id'])}">{$vo.title}</a></td>
						<td>{$vo.send_time|date='Y-m-d',###}</td>
						<td><if condition="$vo['read_time'] == 0">未读<else />已读</if></td>
						<td><if condition="$vo['status'] == 1 ">已回复<elseif condition="$send == 1"/>未回复<else /><a href="{:U('core/message/send','id='.$vo['message_id'])}">回复</a></if></td>
						</if>
						<td><a href="{:U('core/message/delete','id='.$vo['message_id'])}">删除</a></td>
					</tr>
					</volist>
				</tbody>
				<tfoot>
					<tr>
						<td><input type="submit" value="删除" class="btn btn-primary btn-xs"></td>
						<td colspan="6">{$page}<div class="clear"></div></td>
					</tr>
				</tfoot>
				</form>
			</table>
		</div>
	</div>
</div>
<div class="clear"></div>
<script type="text/javascript">
$(function(){
	$("#check_all").click(function(){
		$("input[class='check_list']").prop('checked',$(this).prop('checked'));
	});
}); 
</script>
<include file="Public:alert" />
<include file="Public:footer" />